from django.contrib import admin

# Register your models here.
from app.models import Subject, Teacher, User


class SubjectsAdmin(admin.ModelAdmin):
    list_display = ('no', 'name', 'intro', 'is_hot')
    search_fields = ('name',)
    list_editable = ('name',)


class TeachersAdmin(admin.ModelAdmin):
    list_display = ('no', 'name', 'intro', 'sex', 'birth', 'photo', 'good_count', 'bad_count', 'subject')
    search_fields = ('name',)
    list_editable = ('name', 'sex', 'photo')


admin.site.register(Subject, SubjectsAdmin)
admin.site.register(Teacher, TeachersAdmin)


class UserAdmin(admin.ModelAdmin):
    list_display = ('userid', 'username', 'tel', 'last_visit')
    list_editable = list_display
    list_display_links = None


admin.site.register(User, UserAdmin)
